<template>
  <el-header id="header">
    <div>
      <img style="width:200px;height:40px;margin:20px 0 0 -12px" src="../assets/welcome.png" />
    </div>

    <el-dropdown split-button type="default">
      设置
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item @click="logout">注销</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </el-header>
</template>

<script>
import { removeSessionStorage } from '../utils/common';
export default {
  name: "Header",
  data() {
    return {};
  },
  methods: {
    logout() {
      // 清空标签页状态
    this.$store.commit('clearTab', []);
      this.$router.push({ path: '/login' })
      removeSessionStorage('curuser')
    }
  }
};
</script>

<style scoped>
#header {
  max-height: 50px;
  line-height: 50px;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

#header>h2 {
  color: #0b67b8;
}
</style>